#!/usr/bin/env python
# encoding: utf-8
"""
ThingsItem.py

Created by Christopher Glasman on 2009-04-21.
Copyright (c) 2009 Christopher Glasman. 

This file is part of thingsplot.

thingsplot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

thingsplot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with thingsplot.  If not, see <http://www.gnu.org/licenses/>.

"""

# import sys
# import os
# import time
# from matplotlib import dates
# from numpy import *


class ThingsItem(object):
    """docstring for ThingsItem"""
    def __init__(self, title, id_tag, status, raw_date_created, raw_date_modified, raw_date_completed=None):
        super(ThingsItem, self).__init__()
        self.debug = True
        self.title = title
        self.id_tag = id_tag
        self.status = status
        self.date_created = float(raw_date_created)
        if(raw_date_completed):
            self.date_completed = float(raw_date_completed)
        self.date_modified = float(raw_date_modified)
        self.status_dict = dict([(0, 'Todo'), (2, 'Cancelled'), (3, 'Completed')])
        return

    def get_status(self):
        # print "asking for status on: ", self.title, " status is: ", self.status
        try:
            stat = self.status_dict[self.status]
        except KeyError:
            stat = "Unkown [" + str(self.status) + "]"
            # print "stat: ", stat
        return stat




